import { createApp } from "vue";
// import { createPinia } from "pinia";
import pinia from "./stores/defaultPinia";

import App from "./App.vue";
import router from "./router";
import i18n from "@/assets/lang/index";
import ElementPlus from "element-plus";

import ECharts from "vue-echarts";
import { use } from "echarts/core";
// 引入高德地图
import VueAMap, { initAMapApiLoader } from "@vuemap/vue-amap";

import "element-plus/dist/index.css";
import "@/assets/css/main.scss";
// 引入icon
import "@/assets/iconfont/iconfont.css";
// 引入路由导航
import "@/router/beforeEach";

import { CanvasRenderer } from "echarts/renderers";
import { BarChart, PieChart } from "echarts/charts";
import {
  GridComponent,
  TooltipComponent,
  TitleComponent,
  LegendComponent,
} from "echarts/components";

use([
  CanvasRenderer,
  BarChart,
  PieChart,
  GridComponent,
  TooltipComponent,
  TitleComponent,
  LegendComponent,
]);

initAMapApiLoader({
  key: "e428f5b9195f467814737c68d5a9788a",
  securityJsCode: "678d09fa18f502d8c98a0944bca74d85",
});

const app = createApp(App);

app.component("v-chart", ECharts);
app.use(VueAMap);

app.use(pinia);
app.use(router);

app.use(i18n);
app.use(ElementPlus);

app.mount("#app");
